package com.lz.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;



import lombok.Data;

/*车险单
周浩宇*/
@Data
@Table
@Entity
public class InsuranceSheet implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 8501685970289844947L;
	@Id
	@GeneratedValue(generator = "native")
	@GenericGenerator(name = "native",strategy = "native")
      // 车险单编号
	private Integer insuranceSheetNo;
	  // 投险公司
	private String insuranceCompany;
	  // 登记状态
	private String registrationStatus;
	  //  保险生效日期
	private Date effectiveTime;
      //  保险失效日期
	private Date invalidTime;
	  //  手续费
	private Double handlingFee;
	  // 车险单状态
	private String insuranceSheetState;
	//对应业务员
    @OneToOne(targetEntity=Employee.class) 
	@JoinColumn(name="employeeId")
	@NotFound(action=NotFoundAction.IGNORE)
	private Employee employee;
	//对应客户
	@OneToOne(targetEntity=Customer.class)
	@JoinColumn(name="customerId")
	@NotFound(action=NotFoundAction.IGNORE)
	private Customer customer;
//对应车辆
	@OneToOne(targetEntity=Car.class)
	@JoinColumn(name="carId")
	//@NotFound忽略外部键作用
	@NotFound(action=NotFoundAction.IGNORE)
	private Car car;
}
